#include "GnApplicationPCH.h"
#include "GnDX9Constructor.h"
#include "GnAppWindow.h"


GnDX9Constructor::GnDX9Constructor(void)
{
}

GnDX9Constructor::~GnDX9Constructor(void)
{
}


GnRenderer* GnDX9Constructor::CreateRenderer( GnAppWindow* pWindow )
{
	guint useFlags = GnDX9Renderer::USE_BEST_MULTISAMPLES | GnDX9Renderer::USE_STENCIL;
	
	if( pWindow->IsFullScreen() )
		useFlags |= GnDX9Renderer::USE_FULLSCREEN;
	
	GnWindowHandle pWindowHandle = NULL;
	if( pWindow->IsFullScreen() )
		pWindowHandle = pWindow->GetMainWindowHandle();
	else
		pWindowHandle = pWindow->GetRendererWindowHandle();

	GnDX9Renderer::DX9CreationParameters createParam( useFlags, pWindow->GetWidth(), pWindow->GetHeight(),
		pWindowHandle );
	return GnRenderer::Create( &createParam );
}